﻿# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#

# default values

setenv fw_load_addr "0x84000000"
setenv load_addr "0x80800000"
setenv ramdisk_addr "0x83800000"
setenv rootdev "/dev/mmcblk0p1"
setenv verbosity "1"
setenv console "both"
setenv rootfstype "ext4"
setenv fdt_file imx6sx-udoo-neo-full-m4.dtb

# Print boot source
echo "Booting from SD"

if ext2load mmc 0 ${load_addr} /boot/armbianEnv.txt || fatload mmc 0 ${load_addr} armbianEnv.txt; then
	env import -t ${load_addr} ${filesize}
fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "${consoleargs} console=ttymxc0,115200"; fi

setenv bootargs "root=${rootdev} rootfstype=ext4 rootwait ${consoleargs} rd.dm=0 rd.luks=0 rd.lvm=0 rw uart_from_osc loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}"

ext2load mmc ${mmcdev}:${mmcpart} ${fw_load_addr} /boot/bin/m4startup.fw
ext2load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/zImage
ext2load mmc ${mmcdev}:${mmcpart} ${ramdisk_addr} /boot/uInitrd
ext2load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/dtb/${fdt_file}

bootz ${loadaddr} ${ramdisk_addr} ${fdt_addr}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr 
